<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<LINK href="showAllOrg.files/style.htm" rel=stylesheet>
		<LINK href="showAllOrg.files/content.htm" rel=stylesheet>
		
<title>装箱单</title>
 <script type="text/javascript">
		    var djConfig = {
				isDebug:true,
				parseOnLoad:true,
				usePlainJson:true
		    };
		</script>
		 
		<script type="text/javascript" src="dojo/dojo/dojo.js"></script>
		<script type="text/javascript" src="dojo/dijit/dijit.js"></script>

		<script type="text/javascript">
    		dojo.require("dijit.form.Button");
    		dojo.require("dojo.rpc.JsonService");    	
    	</script>
    	<script language="JavaScript" type="text/javascript">
    		var orderBoxService = new dojo.rpc.JsonService("box/order/OrderBoxService?smd");
    		var orderPlanImportService = new dojo.rpc.JsonService("box/alloc/OrderPlanImportService?smd");
			var makeShipperNoteService = new dojo.rpc.JsonService("box/order/MakeShipperNoteService?smd");

    		//页面加载时的一些操作
			dojo.addOnLoad(load);
			function load() {
				initPage();
			}
			function initPage() {
				makeShipperNoteService.getOrderPlan().addCallback(function (orderPlan) {
					makeShipperNoteService.getAllocDetails().addCallback(function (ad) {
						makeShipperNoteService.getShipperNote().addCallback(function (sn) {
							orderBoxService.getLoadLoc().addCallback(function (loadLoc) {
								console.dir(ad);
								document.getElementById("sn_id1").value = sn.id + "批装箱单明细";
								document.getElementById("last_modified_date").innerHTML = "上次更改日期：" + showDate();
								document.getElementById("sn_id2").innerHTML = "第" + sn.id + "批";
								document.getElementById("shipname").innerHTML = orderPlan.shipSchedule.shipInfo.name;
								document.getElementById("shipcom").innerHTML = orderPlan.shipSchedule.shipInfo.shipComInfo.shortTitle;
								document.getElementById("scd_id").innerHTML = orderPlan.shipSchedule.id;
								document.getElementById("sender_contact").value = ad.commission.sender.customerContact.name;
								document.getElementById("sender_name").innerHTML = ad.commission.sender.name;
								document.getElementById("sender_tel").value = ad.commission.sender.tel;
								document.getElementById("receiver").innerHTML = ad.commission.receiver.name;
								document.getElementById("receiver_contact").value = ad.commission.receiver.customerContact.name;
								document.getElementById("receiver_tel").value = ad.commission.receiver.tel;
								document.getElementById("notifier").innerHTML = ad.commission.notifier.name;
								document.getElementById("notifier_contact").value = ad.commission.notifier.customerContact.name;
								document.getElementById("notifier_tel").value = ad.commission.notifier.tel;
								document.getElementById("load_loc").value = loadLoc;
								document.getElementById("load_port").innerHTML = ad.commission.departure;
								document.getElementById("destination1").innerHTML = ad.commission.destination;
								document.getElementById("destination2").innerHTML = ad.commission.destination;
								makeShipperNoteService.getBoxAndGoods(sn.id).addCallback(function (BAG) {
									var bag = BAG.list;
									var tbl = document.getElementById("box_and_goods");
									
									for (var i in bag) {
										console.dir(bag[i]);
										var text = "";

										if (bag[i].box.status == 1) {
											text = text + "<td width='70' align='center'><a href='javascript:make_container_load(" + bag[i].id + ")'><img src='showAllOrg.files/cus.gif' border='0'/></a></td>";
											text = text + "<td width='70' align='center'>未制装箱单</td>";
										} else if (bag[i].box.status == 2) {
											text = text + "<td width='70' align='center'><a href='javascript:show_container_load(" + bag[i].id + ")'><img src='showAllOrg.files/view.gif' border='0'/></a></td>";
											text = text + "<td width='70' align='center'>已制装箱单</td>";
										}
										text = text + "<td width='70' align='center'>" + bag[i].box.id + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].box.type  + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].goods.type  + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].goodsNum  + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].goods.weight*bag[i].goodsNum  + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].goods.size*bag[i].goodsNum  + "</td>";
										text = text + "<td width='70' align='center'>无</td>";

										var tr = document.createElement("tr");
										tr.className = "gridtreven";
										tbl.appendChild(tr);
										tr.innerHTML = text;
									}
								});
							});
						});
					});
				});
			}
			//得到当前日期
			function showDate() {
				var today = new Date();   
				var day = today.getDate();   
				var month = today.getMonth() + 1;   
				var year = today.getFullYear();   
				return year + "-" + month + "-" + day;
			}
			//制装箱单
			function make_container_load(bagId) {
				orderBoxService.setBagId(bagId).addCallback(function () {
					window.open("装箱单明细.htm", "_self");
				});
			}
			//装箱单明细
			function show_container_load(bagId) {
				orderBoxService.setBagId(bagId).addCallback(function () {
					window.open("显示装箱单明细.htm", "_self");
				});
			}
    	</script>
</head>
<body>

<font face="隶书" color="3656B9" ; style="font-size: 18px;">装箱单</font><br>
<img src="showAllOrg.files/line2.gif"><br>

<center>


	<table width="700" border="0" cellpadding="0" cellspacing="0" >		
     	 <tr height="80">
       <td class="ctitle" ><input id="sn_id1" class ="billtitle" value="10022批装箱单明细" size=40></td>
      </tr>
	</table>

	<table width="760" border="0" cellpadding="0" cellspacing="0" >
    <tr>
    <td	class="ctitle" id="last_modified_date" >上次更改日期：</td>
	    
	
    <td class="ctitle"  id="sn_id2" >
    第10022批</td>
	
	<td class="rtitle">单据类型：</td>  <td  	class="ltitle"><select name="Bill_type">
			<option value="I" selected="selected">初始化单据</option>
			  </select>        
          </td>
    </tr>
	</table>

	<table  class="titlearea" width="760" border="0" cellpadding="2" cellspacing="1">
      <tr >
			 <td		class="rtitle" width=95>*船公司：</td>
             <td  id="shipcom"	class="ltitle">华东海运</td> 
             <td		class="rtitle" width=95>*船名：</td>
             <td  id="shipname"	class="ltitle">华东明珠2号</td>
		  <td	class="rtitle" width=95>*船次：</td>
          <td  id="scd_id"	class="ltitle">1342</td>
      </tr >
	  <tr >
			 <td		class="rtitle" width=95>*发货人：</td>
        <td  id="sender_name"	class="ltitle">威海出口公司</td> 
          <td		class="rtitle" width=95>*联系人：</td>
        <td  	class="ltitle"><input id="sender_contact" type="text" name="Ware_name2"
          value="张三" 	  size=10 class="linput" ></td>
		  <td		class="rtitle" width=95>*联系电话：</td>
        <td  	class="ltitle"><input id="sender_tel" type="text" name="Ware_name22"
          value="13012345678" 	  size=10 class="linput" ></td>
      </tr >
	  <tr >
			 <td		class="rtitle" width=95>*收货人：</td>
             <td  id="receiver"	class="ltitle">韩国进口公司</td> 
             <td		class="rtitle" width=95>*联系人：</td>
        <td  	class="ltitle"><input id="receiver_contact" type="text" name="Ware_name2"
          value="李四" 	  size=10 class="linput" ></td>
		  <td		class="rtitle" width=95>*联系电话：</td>
        <td  	class="ltitle"><input id="receiver_tel" type="text" name="Ware_name22"
          value="13087654321" 	  size=10 class="linput" ></td>
      </tr >
	  <tr >
			 <td		class="rtitle" width=95>*通知人：</td>
             <td  id="notifier"	class="ltitle">韩国进口公司</td> 
          <td		class="rtitle" width=95>*联系人：</td>
        <td  	class="ltitle"><input id="notifier_contact" type="text" name="Ware_name2"
          value="李四" 	  size=10 class="linput" ></td>
		  <td		class="rtitle" width=95>*联系电话：</td>
        <td  	class="ltitle"><input id="notifier_tel" type="text" name="Ware_name22"
          value="13087654321" 	  size=10 class="linput" ></td>
      </tr >
             <tr >
			 <td		class="rtitle" width=95>货代：</td>
			
          <td  	class="ltitle">哈工大货代         
          </td> 
          <td		class="rtitle" width=95>许可证号：</td>
          <td  	class="ltitle">200334422         
          </td>
		  <td		class="rtitle" width=95>装货地：</td>
          <td  	class="ltitle"><input id="load_loc" type="text" name="Ware_name"
          value="威海路10022号" 	  size=10 class="linput" >         
          </td>
		   </tr >
		  
		   <tr >
			 <td		class="rtitle" width=95>装货港：</td>
			
          <td id="load_port" 	class="ltitle">SHIDAO,CHINA         
          </td> 
          <td		class="rtitle" width=95>卸货港：</td>
          <td  id="destination1"	class="ltitle">INCHON,KOREA         
          </td>
		  <td		class="rtitle" width=95>目的港：</td>
          <td  id="destination2"	class="ltitle">INCHON,KOREA         
          </td>
		   </tr >
		 
  
	  <tr>
          <td class="rtitle">审批状态：</td>
          <td class="ltitle">  
          
			未提交</td>
          <td class="rtitle">审批流程：</td><td class="ltitle" colspan="3">        
          <input name="Check_flow_id"   type="hidden" value="StoreStart001" size="10" class="linputrl">
          <input name="Check_flow_name" type="text"   value="缮制" size="20" class="linputr">
          <input name="Audit_state_flag" type="hidden" value="S" size="10" class="linputrl">
          </td>
      </tr>
	  
	</table>

<table width="760">
    <tr>
      <td class="rtitle">
	    
      <font face="Webdings" class="redcolor">4</font><a href="javascript:myClose()">关闭</a>
      
      
      <font face="Webdings" class="redcolor">4</font><a href="#" onclick="java:window.history.go(-1)">返回</a>
      
	  </td>
	</tr>
</table>

<table width=760>
<tr>
<td align="left">
 <a href="#"><font  id="ctrInfFont0" color="blue" >子装箱单列表</font></a>
</td>
</tr>
</table>


    
          <table id="box_and_goods" width="760" align="center" cellpadding="2" cellspacing="1" class=gridarea>
            <tr>
                <td width="70" class="gridtitletd" align="center">操作 </td>		
                <td width="70" class="gridtitletd" align="center">状态</td>							
				<td width="70" class="gridtitletd" align="center">集装箱序号 </td>
				<td width="70" class="gridtitletd" align="center">箱型</td>
				<td width="70" class="gridtitletd" align="center">货物名称</td>
				<td width="70" class="gridtitletd" align="center">件数与包装</td>
				<td width="70" class="gridtitletd" align="center">毛重</td>
				<td width="70" class="gridtitletd" align="center">尺寸</td>
				<td width="70" class="gridtitletd" align="center">备注</td>
			</tr>
          </table>
           


  <table width="760">
    <tr>
      <td class="ltitle" width="90%">
      	
      	
    		<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' height='30'>
<tr>
 <td width='100%' align='left'> <a href='javascript: firstPage_2()'><img src='images/first.gif' width='20' border='0' height='15'></a><a href='javascript: prevPage_2()'><img src='images/first1.gif' width='20' border='0' height='15'></a> <input class='linput' size='3' value='1' onKeyPress='return locate_2(this);'> 
 <a href='javascript: nextPage_2()'><img src='images/last1.gif' width='20' border='0' height='15'></a><a href='javascript: lastPage_2()'><img src='images/last.gif' width='20' border='0' height='15'></a>&nbsp;
 第1页/共1页
 </td>
</tr>
</table>


      </td>
    </tr>
  </table>
</center>

</body>
</html>


